package com.emmy.walnut.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;

import com.emmy.walnut.model.User;

/**
 * @ClassName UserDao
 * @Description TODO
 * @Author zhouxuan
 * @Date 2020/02/04 12:21
 * @Version 1.0
 */
@Dao
public interface UserDao {

    @Insert(onConflict = OnConflictStrategy.FAIL)
    long insert(User user);

    @Query("select * from user where username = :name")
    User query(String name);

    @Delete
    void delete(User user);

}
